﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AteneoLibriBusinessLogic.Entities;

namespace AteneoLibriBusinessLogic.TOA
{
    public class UniversityAssembler
    {

        public static University Assembler(AteneoLibriEntityFramework.University item)
        {
            University u = new University();

            u.IdUniversity = item.IdUniversity;
            u.Name = item.Name;
            u.NationId = item.NationId;
            u.CityId = item.CityId;
            u.Address = item.Address;
            u.ZipCode = item.ZipCode;

            u.Logo = item.Logo;
            u.PhotoCover = item.PhotoCover;

            return u;
        }

        public static AteneoLibriEntityFramework.University DeAssembler(University item)
        {
            AteneoLibriEntityFramework.University u = new AteneoLibriEntityFramework.University();

            u.IdUniversity = item.IdUniversity;
            u.Name = item.Name;
            u.NationId = item.NationId;
            u.CityId = item.CityId;
            u.Address = item.Address;
            u.ZipCode = item.ZipCode;

            u.Logo = item.Logo;
            u.PhotoCover = item.PhotoCover;

            return u;
        }

        public static void WriteToEntity(AteneoLibriEntityFramework.University entity, University item)
        {
            entity.IdUniversity = item.IdUniversity;
            entity.Name = item.Name;
            entity.NationId = item.NationId;
            entity.CityId = item.CityId;
            entity.Address = item.Address;
            entity.ZipCode = item.ZipCode;

            entity.Logo = item.Logo;
            entity.PhotoCover = item.PhotoCover;
        }
    }
}
